/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gmovil_jpa.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author castlerock
 */
@Entity
@Table(name = "agencia_comercial")
@NamedQueries({
    @NamedQuery(name = "AgenciaComercial.findAll", query = "SELECT a FROM AgenciaComercial a"),
    @NamedQuery(name = "AgenciaComercial.findByIdAgenciaComercial", query = "SELECT a FROM AgenciaComercial a WHERE a.idAgenciaComercial = :idAgenciaComercial"),
    @NamedQuery(name = "AgenciaComercial.findByAgenciaComercial", query = "SELECT a FROM AgenciaComercial a WHERE a.agenciaComercial = :agenciaComercial"),
    @NamedQuery(name = "AgenciaComercial.findByBarrioDireccionPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.barrioDireccionPrincipal = :barrioDireccionPrincipal"),
    @NamedQuery(name = "AgenciaComercial.findByDireccionPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.direccionPrincipal = :direccionPrincipal"),
    @NamedQuery(name = "AgenciaComercial.findByTelefonoPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.telefonoPrincipal = :telefonoPrincipal"),
    @NamedQuery(name = "AgenciaComercial.findByFaxPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.faxPrincipal = :faxPrincipal"),
    @NamedQuery(name = "AgenciaComercial.findByMovilPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.movilPrincipal = :movilPrincipal"),
    @NamedQuery(name = "AgenciaComercial.findByEmailPrincipal", query = "SELECT a FROM AgenciaComercial a WHERE a.emailPrincipal = :emailPrincipal")})
public class AgenciaComercial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_agencia_comercial")
    private Integer idAgenciaComercial;
    @Basic(optional = false)
    @Column(name = "agencia_comercial")
    private String agenciaComercial;
    @Basic(optional = false)
    @Column(name = "barrio_direccion_principal")
    private String barrioDireccionPrincipal;
    @Basic(optional = false)
    @Column(name = "direccion_principal")
    private String direccionPrincipal;
    @Basic(optional = false)
    @Column(name = "telefono_principal")
    private String telefonoPrincipal;
    @Column(name = "fax_principal")
    private String faxPrincipal;
    @Column(name = "movil_principal")
    private String movilPrincipal;
    @Column(name = "email_principal")
    private String emailPrincipal;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "agenciaComercial")
    private List<PuntoVenta> puntoVentaList;

    public AgenciaComercial() {
    }

    public AgenciaComercial(Integer idAgenciaComercial) {
        this.idAgenciaComercial = idAgenciaComercial;
    }

    public AgenciaComercial(Integer idAgenciaComercial, String agenciaComercial, String barrioDireccionPrincipal, String direccionPrincipal, String telefonoPrincipal) {
        this.idAgenciaComercial = idAgenciaComercial;
        this.agenciaComercial = agenciaComercial;
        this.barrioDireccionPrincipal = barrioDireccionPrincipal;
        this.direccionPrincipal = direccionPrincipal;
        this.telefonoPrincipal = telefonoPrincipal;
    }

    public Integer getIdAgenciaComercial() {
        return idAgenciaComercial;
    }

    public void setIdAgenciaComercial(Integer idAgenciaComercial) {
        this.idAgenciaComercial = idAgenciaComercial;
    }

    public String getAgenciaComercial() {
        return agenciaComercial;
    }

    public void setAgenciaComercial(String agenciaComercial) {
        this.agenciaComercial = agenciaComercial;
    }

    public String getBarrioDireccionPrincipal() {
        return barrioDireccionPrincipal;
    }

    public void setBarrioDireccionPrincipal(String barrioDireccionPrincipal) {
        this.barrioDireccionPrincipal = barrioDireccionPrincipal;
    }

    public String getDireccionPrincipal() {
        return direccionPrincipal;
    }

    public void setDireccionPrincipal(String direccionPrincipal) {
        this.direccionPrincipal = direccionPrincipal;
    }

    public String getTelefonoPrincipal() {
        return telefonoPrincipal;
    }

    public void setTelefonoPrincipal(String telefonoPrincipal) {
        this.telefonoPrincipal = telefonoPrincipal;
    }

    public String getFaxPrincipal() {
        return faxPrincipal;
    }

    public void setFaxPrincipal(String faxPrincipal) {
        this.faxPrincipal = faxPrincipal;
    }

    public String getMovilPrincipal() {
        return movilPrincipal;
    }

    public void setMovilPrincipal(String movilPrincipal) {
        this.movilPrincipal = movilPrincipal;
    }

    public String getEmailPrincipal() {
        return emailPrincipal;
    }

    public void setEmailPrincipal(String emailPrincipal) {
        this.emailPrincipal = emailPrincipal;
    }

    public List<PuntoVenta> getPuntoVentaList() {
        return puntoVentaList;
    }

    public void setPuntoVentaList(List<PuntoVenta> puntoVentaList) {
        this.puntoVentaList = puntoVentaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAgenciaComercial != null ? idAgenciaComercial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AgenciaComercial)) {
            return false;
        }
        AgenciaComercial other = (AgenciaComercial) object;
        if ((this.idAgenciaComercial == null && other.idAgenciaComercial != null) || (this.idAgenciaComercial != null && !this.idAgenciaComercial.equals(other.idAgenciaComercial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gmovil_jpa.entidades.AgenciaComercial[idAgenciaComercial=" + idAgenciaComercial + "]";
    }

}
